<template>
  <div class="admin-outline-box">
    <div class="content">
      <div class="video">
        456
      </div>
      <div class="navigationBar">
        <el-tree :data="outlineList" :props="defaultProps" @node-click="handleNodeClick" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Outline',
  data() {
    return {
      // 课程大纲数据
      outlineList: [],
      // 当前正在播放的视频地址，默认是第一章节的第一节
      videoWatching: '',
      // 树形空间格式
      defaultProps: {
        children: 'children',
        label: 'name'
      }
    }
  },
  created() {
    this.outlineList = this.$route.query
    this.videoWatching = this.outlineList[0].children[0].video
  },
  methods: {
    // 树形控件点击切换，更改正在播放的视频地址
    handleNodeClick(data) {
      console.log(data)
    }
  }
}
</script>

<style lang="scss" scoped>
.admin-outline-box{
  padding: 30px;
  .content{
    width: 95%;
    height: 500px;
    margin: 0 auto;
    border: 1px solid red;
    display: flex;
    .video{
      flex: 8;
    }
    .navigationBar{
      flex: 3;
    }
  }
}
</style>
